<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .focus {
        border: 2px solid #38f;
      }

      input {
        outline: none;
      }
    </style>
  </head>
  <body>
    <input style="height: 100px; width: 100px" id="inp" />
    <script>
      window.onload = function () {
        let p = document.getElementById("inp");
        p.addEventListener(
          "focus",
          () => {
            p.className = "focus";
          },
          false
        );
      };
    </script>
  </body>
</html>
